
import request from '@/utils/request'

const api = {
    getLaborSignUserList: '/v1/labor/sign/user/page/list', // 获取人员列表数据
    getLaborSignUserSettlementList: '/v1/labor/sign/user/settlement/page/list', // 获取人员结算记录
    getLaborSignUserContractList: '/v1/labor/sign/user/contract/page/list', // 获取人员合同记录
    downloadSignUser: '/v1/labor/sign/user/export', // 导出人员信息
    getSelfEmployedList: '/v1/self/employed/page/list', // 获取个体户分页列表
    checkSelfEmployedSuccess: '/v1/self/employed/success', // 个体户审核成功
    updateBusinessLicense: '/v1/self/employed/updateBusinessLicense', // 个体户更换营业执照
    checkSelfEmployedFail: '/v1/self/employed/fail', // 个体户审核失败
    exportSelfEmployed: '/v1/self/employed/export', // 导出个体户申请列表
}

// 获取人员列表数据
export function getLaborSignUserList (parameter) {
    return request({
        url: api.getLaborSignUserList,
        method: 'get',
        headers: {
            'name':'getLaborSignUserList',
        },
        params: parameter
    })
}

// 获取人员结算记录 
export function getLaborSignUserSettlementList (parameter) {
    return request({
        url: api.getLaborSignUserSettlementList,
        method: 'get',
        headers: {
            'name':'getLaborSignUserSettlementList',
        },
        params: parameter
    })
}

// 获取人员合同记录
export function getLaborSignUserContractList (parameter) {
    return request({
        url: api.getLaborSignUserContractList,
        method: 'get',
        headers: {
            'name':'getLaborSignUserContractList',
        },
        params: parameter
    })
}

// 导出人员信息
export function downloadSignUser(parameter) {
    return request({
        url: api.downloadSignUser,
        method: 'get',
        responseType: "arraybuffer",
        headers: {
            'name':'downloadSignUser',
        },
        params: parameter
    })
}

// 获取个体户分页列表
export function getSelfEmployedList (parameter) {
    return request({
        url: api.getSelfEmployedList,
        method: 'get',
        headers: {
            'name':'getSelfEmployedList',
        },
        params: parameter
    })
}
// 审核通过个体户申请
export function checkSelfEmployedSuccess (parameter) {
    return request({
        url: api.checkSelfEmployedSuccess,
        method: 'post',
        headers: {
            'name':'checkSelfEmployedSuccess',
        },
        data: parameter
    })
}
// 更新营业执照 
export function updateBusinessLicense (parameter) {
    return request({
        url: api.updateBusinessLicense,
        method: 'post',
        headers: {
            'name':'updateBusinessLicense',
        },
        data: parameter
    })
}
// 审核拒绝个体户申请
export function checkSelfEmployedFail (parameter) {
    return request({
        url: api.checkSelfEmployedFail,
        method: 'post',
        headers: {
            'name':'checkSelfEmployedFail',
        },
        data: parameter
    })
}
// 导出个体户申请列表
export function exportSelfEmployed(parameter) {
    return request({
        url: api.exportSelfEmployed,
        method: 'get',
        responseType: "arraybuffer",
        headers: {
            'name':'exportSelfEmployed',
        },
        params: parameter
    })
}